// import request from './request' // 暂时注释，等真实API接口准备好后可以启用

// 门诊服务数据接口
export interface OutpatientService {
  id: number
  name: string
  icon: string
  color: string
  description?: string
  route?: string
}

// 住院服务数据接口
export interface InpatientService {
  id: number
  name: string
  icon: string
  color: string
  description?: string
  route?: string
}

// 综合服务数据接口
export interface ComprehensiveService {
  id: number
  name: string
  icon: string
  color: string
  description?: string
  route?: string
}

// 健康资讯接口
export interface HealthInfo {
  id: number
  title: string
  tag: string
  likes: number
  views: number
  cover: string
  summary?: string
  publishTime?: string
}

// 获取门诊服务列表
export const getOutpatientServices = async (): Promise<OutpatientService[]> => {
  try {
    // 这里可以替换为真实的API调用
    // const response = await request.get('/outpatient/services')
    // return response.data
    
    // 模拟数据 - 扩展更多服务
    return [
      { id: 1, name: '门诊报告', icon: '📄', color: '#e8f3ff', description: '查看门诊检查报告', route: '/outpatient-report' },
      { id: 2, name: '候诊查询', icon: '⏱️', color: '#e9f7ef', description: '实时查询候诊状态', route: '/outpatient/waiting' },
      { id: 3, name: '自助开单', icon: '🧾', color: '#fff2e8', description: '自助开具检查单', route: '/outpatient/order' },
      { id: 4, name: '医技预约', icon: '🏥', color: '#f2ecff', description: '预约医技检查', route: '/outpatient/appointment' },
      { id: 5, name: '我的复诊', icon: '♻️', color: '#e8f7ff', description: '查看复诊安排', route: '/outpatient/followup' },
      { id: 6, name: '自助取号', icon: '🎫', color: '#fff0f5', description: '自助取号排队', route: '/outpatient/queue' },
      { id: 7, name: '门诊导诊单', icon: '🧭', color: '#eff8ff', description: '门诊导诊服务', route: '/outpatient/guide' },
      { id: 8, name: '电子票据', icon: '🧾', color: '#f3ffe9', description: '查看电子票据', route: '/outpatient/invoice' },
      { id: 9, name: '预约挂号', icon: '📅', color: '#fff8e1', description: '在线预约挂号', route: '/outpatient/register' },
      { id: 10, name: '费用查询', icon: '💰', color: '#f3e5f5', description: '查询门诊费用', route: '/outpatient/cost' },
      { id: 11, name: '检查结果', icon: '🔬', color: '#e8f5e8', description: '查看检查结果', route: '/outpatient/results' },
      { id: 12, name: '用药指导', icon: '💊', color: '#fff3e0', description: '用药指导服务', route: '/outpatient/medicine' },
      { id: 13, name: '健康档案', icon: '📋', color: '#fce4ec', description: '个人健康档案', route: '/outpatient/health-record' },
      { id: 14, name: '体检预约', icon: '🔍', color: '#e3f2fd', description: '体检预约服务', route: '/outpatient/checkup' },
      { id: 15, name: '专家咨询', icon: '👨‍⚕️', color: '#f1f8e9', description: '专家在线咨询', route: '/outpatient/consultation' },
      { id: 16, name: '慢病管理', icon: '📊', color: '#fff8e1', description: '慢病管理服务', route: '/outpatient/chronic' }
    ]
  } catch (error) {
    console.error('获取门诊服务失败:', error)
    return []
  }
}

// 获取住院服务列表
export const getInpatientServices = async (): Promise<InpatientService[]> => {
  try {
    // 这里可以替换为真实的API调用
    // const response = await request.get('/inpatient/services')
    // return response.data
    
    // 模拟数据 - 扩展更多服务
    return [
      { id: 1, name: '住院登记', icon: '🏥', color: '#e8f3ff', description: '办理住院手续', route: '/inpatient/register' },
      { id: 2, name: '病房查询', icon: '🛏️', color: '#e9f7ef', description: '查询病房信息', route: '/inpatient/room' },
      { id: 3, name: '探视预约', icon: '👥', color: '#fff2e8', description: '预约探视时间', route: '/inpatient/visit' },
      { id: 4, name: '费用查询', icon: '💰', color: '#f2ecff', description: '查询住院费用', route: '/inpatient/cost' },
      { id: 5, name: '出院办理', icon: '🚪', color: '#e8f7ff', description: '办理出院手续', route: '/inpatient/discharge' },
      { id: 6, name: '护理服务', icon: '👩‍⚕️', color: '#fff0f5', description: '护理服务安排', route: '/inpatient/nursing' },
      { id: 7, name: '营养配餐', icon: '🍽️', color: '#eff8ff', description: '营养配餐服务', route: '/inpatient/meal' },
      { id: 8, name: '康复指导', icon: '💪', color: '#f3ffe9', description: '康复指导服务', route: '/inpatient/rehabilitation' },
      { id: 9, name: '手术安排', icon: '⚕️', color: '#fff8e1', description: '手术时间安排', route: '/inpatient/surgery' },
      { id: 10, name: '检查预约', icon: '🔬', color: '#f3e5f5', description: '住院检查预约', route: '/inpatient/examination' },
      { id: 11, name: '用药提醒', icon: '💊', color: '#e8f5e8', description: '用药时间提醒', route: '/inpatient/medication' },
      { id: 12, name: '病情记录', icon: '📝', color: '#fff3e0', description: '病情变化记录', route: '/inpatient/condition' },
      { id: 13, name: '家属沟通', icon: '📞', color: '#fce4ec', description: '与家属沟通平台', route: '/inpatient/family' },
      { id: 14, name: '心理疏导', icon: '🧠', color: '#e3f2fd', description: '心理疏导服务', route: '/inpatient/psychology' },
      { id: 15, name: '疼痛管理', icon: '😣', color: '#f1f8e9', description: '疼痛管理服务', route: '/inpatient/pain' },
      { id: 16, name: '出院随访', icon: '📋', color: '#fff8e1', description: '出院后随访安排', route: '/inpatient/followup' }
    ]
  } catch (error) {
    console.error('获取住院服务失败:', error)
    return []
  }
}

// 获取综合服务列表
export const getComprehensiveServices = async (): Promise<ComprehensiveService[]> => {
  try {
    // 这里可以替换为真实的API调用
    // const response = await request.get('/comprehensive/services')
    // return response.data
    
    // 模拟数据 - 扩展更多服务
    return [
      { id: 1, name: '健康档案', icon: '📋', color: '#e8f3ff', description: '查看健康档案', route: '/comprehensive/health-record' },
      { id: 2, name: '体检预约', icon: '🔍', color: '#e9f7ef', description: '预约体检服务', route: '/comprehensive/checkup' },
      { id: 3, name: '疫苗接种', icon: '💉', color: '#fff2e8', description: '疫苗接种服务', route: '/comprehensive/vaccine' },
      { id: 4, name: '心理咨询', icon: '🧠', color: '#f2ecff', description: '心理咨询服务', route: '/comprehensive/psychology' },
      { id: 5, name: '中医调理', icon: '🌿', color: '#e8f7ff', description: '中医调理服务', route: '/comprehensive/tcm' },
      { id: 6, name: '营养咨询', icon: '🥗', color: '#fff0f5', description: '营养咨询服务', route: '/comprehensive/nutrition' },
      { id: 7, name: '运动康复', icon: '🏃', color: '#eff8ff', description: '运动康复服务', route: '/comprehensive/exercise' },
      { id: 8, name: '慢病管理', icon: '📊', color: '#f3ffe9', description: '慢病管理服务', route: '/comprehensive/chronic' },
      { id: 9, name: '健康评估', icon: '📈', color: '#fff8e1', description: '健康风险评估', route: '/comprehensive/assessment' },
      { id: 10, name: '基因检测', icon: '🧬', color: '#f3e5f5', description: '基因检测服务', route: '/comprehensive/gene' },
      { id: 11, name: '美容整形', icon: '✨', color: '#e8f5e8', description: '美容整形咨询', route: '/comprehensive/beauty' },
      { id: 12, name: '口腔护理', icon: '🦷', color: '#fff3e0', description: '口腔护理服务', route: '/comprehensive/dental' },
      { id: 13, name: '眼科检查', icon: '👁️', color: '#fce4ec', description: '眼科检查服务', route: '/comprehensive/eye' },
      { id: 14, name: '听力检测', icon: '👂', color: '#e3f2fd', description: '听力检测服务', route: '/comprehensive/hearing' },
      { id: 15, name: '皮肤护理', icon: '🧴', color: '#f1f8e9', description: '皮肤护理服务', route: '/comprehensive/skin' },
      { id: 16, name: '骨密度检测', icon: '🦴', color: '#fff8e1', description: '骨密度检测服务', route: '/comprehensive/bone' }
    ]
  } catch (error) {
    console.error('获取综合服务失败:', error)
    return []
  }
}

// 获取健康资讯列表
export const getHealthInfo = async (): Promise<HealthInfo[]> => {
  try {
    // 这里可以替换为真实的API调用
    // const response = await request.get('/health/info')
    // return response.data
    
    // 模拟数据 - 扩展更多健康资讯
    return [
      { 
        id: 1, 
        title: '世界糖尿病日，应该注意什么来调节？', 
        tag: '#健康养生', 
        likes: 520, 
        views: 2000, 
        cover: 'https://images.unsplash.com/photo-1582719478250-c89cae4dc85b?w=300&h=200&fit=crop',
        summary: '糖尿病是一种常见的慢性疾病，通过合理的饮食控制和运动可以有效控制血糖水平...',
        publishTime: '2024-01-15'
      },
      { 
        id: 2, 
        title: '冬季养生小贴士：如何增强免疫力', 
        tag: '#季节养生', 
        likes: 380, 
        views: 1500, 
        cover: 'https://images.unsplash.com/photo-1583324113626-70df0f4deaab?w=300&h=200&fit=crop',
        summary: '冬季是感冒高发季节，通过合理的饮食、运动和作息可以增强身体免疫力...',
        publishTime: '2024-01-14'
      },
      { 
        id: 3, 
        title: '高血压患者的饮食注意事项', 
        tag: '#疾病预防', 
        likes: 450, 
        views: 1800, 
        cover: 'https://images.unsplash.com/photo-1584982751601-97dcc096659c?w=300&h=200&fit=crop',
        summary: '高血压患者需要控制盐分摄入，多吃蔬菜水果，适量运动...',
        publishTime: '2024-01-13'
      },
      { 
        id: 4, 
        title: '春季养生：如何调理肝气', 
        tag: '#中医养生', 
        likes: 320, 
        views: 1200, 
        cover: 'https://images.unsplash.com/photo-1571019613454-1cb2f99b2d8b?w=300&h=200&fit=crop',
        summary: '春季是肝气旺盛的季节，通过合理的饮食和作息可以调理肝气，保持身体健康...',
        publishTime: '2024-01-12'
      },
      { 
        id: 5, 
        title: '夏季防暑降温的实用方法', 
        tag: '#季节养生', 
        likes: 280, 
        views: 1100, 
        cover: 'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=300&h=200&fit=crop',
        summary: '夏季高温容易中暑，通过合理的防暑降温方法可以有效预防中暑...',
        publishTime: '2024-01-11'
      },
      { 
        id: 6, 
        title: '秋季润燥：如何保养肺部', 
        tag: '#中医养生', 
        likes: 350, 
        views: 1300, 
        cover: 'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=300&h=200&fit=crop',
        summary: '秋季气候干燥，容易伤肺，通过合理的饮食和运动可以保养肺部...',
        publishTime: '2024-01-10'
      },
      { 
        id: 7, 
        title: '心脏病患者的运动指南', 
        tag: '#疾病预防', 
        likes: 420, 
        views: 1600, 
        cover: 'https://images.unsplash.com/photo-1571019613454-1cb2f99b2d8b?w=300&h=200&fit=crop',
        summary: '心脏病患者需要适当的运动来增强心脏功能，但要注意运动强度...',
        publishTime: '2024-01-09'
      },
      { 
        id: 8, 
        title: '失眠患者的调理方法', 
        tag: '#健康养生', 
        likes: 380, 
        views: 1400, 
        cover: 'https://images.unsplash.com/photo-1582719478250-c89cae4dc85b?w=300&h=200&fit=crop',
        summary: '失眠是现代人常见的问题，通过合理的作息和心理调节可以改善睡眠质量...',
        publishTime: '2024-01-08'
      },
      { 
        id: 9, 
        title: '骨质疏松的预防和治疗', 
        tag: '#疾病预防', 
        likes: 290, 
        views: 1000, 
        cover: 'https://images.unsplash.com/photo-1583324113626-70df0f4deaab?w=300&h=200&fit=crop',
        summary: '骨质疏松是中老年人常见的问题，通过合理的饮食和运动可以预防...',
        publishTime: '2024-01-07'
      },
      { 
        id: 10, 
        title: '肠胃炎的饮食调理', 
        tag: '#健康养生', 
        likes: 310, 
        views: 1150, 
        cover: 'https://images.unsplash.com/photo-1584982751601-97dcc096659c?w=300&h=200&fit=crop',
        summary: '肠胃炎患者需要注意饮食调理，避免刺激性食物，多吃易消化的食物...',
        publishTime: '2024-01-06'
      },
      { 
        id: 11, 
        title: '颈椎病的预防和康复', 
        tag: '#疾病预防', 
        likes: 340, 
        views: 1250, 
        cover: 'https://images.unsplash.com/photo-1571019613454-1cb2f99b2d8b?w=300&h=200&fit=crop',
        summary: '颈椎病是现代人常见的问题，通过正确的坐姿和运动可以预防...',
        publishTime: '2024-01-05'
      },
      { 
        id: 12, 
        title: '抑郁症的早期识别和治疗', 
        tag: '#心理健康', 
        likes: 260, 
        views: 950, 
        cover: 'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=300&h=200&fit=crop',
        summary: '抑郁症是一种常见的心理疾病，早期识别和治疗非常重要...',
        publishTime: '2024-01-04'
      },
      { 
        id: 13, 
        title: '儿童营养搭配指南', 
        tag: '#健康养生', 
        likes: 370, 
        views: 1350, 
        cover: 'https://images.unsplash.com/photo-1582719478250-c89cae4dc85b?w=300&h=200&fit=crop',
        summary: '儿童正处于生长发育期，合理的营养搭配对健康成长非常重要...',
        publishTime: '2024-01-03'
      },
      { 
        id: 14, 
        title: '老年人保健知识大全', 
        tag: '#健康养生', 
        likes: 400, 
        views: 1450, 
        cover: 'https://images.unsplash.com/photo-1583324113626-70df0f4deaab?w=300&h=200&fit=crop',
        summary: '老年人需要特别的保健知识，通过合理的饮食和运动可以延年益寿...',
        publishTime: '2024-01-02'
      },
      { 
        id: 15, 
        title: '孕妇营养补充指南', 
        tag: '#母婴健康', 
        likes: 330, 
        views: 1200, 
        cover: 'https://images.unsplash.com/photo-1584982751601-97dcc096659c?w=300&h=200&fit=crop',
        summary: '孕妇需要特别的营养补充，合理的饮食对胎儿发育非常重要...',
        publishTime: '2024-01-01'
      }
    ]
  } catch (error) {
    console.error('获取健康资讯失败:', error)
    return []
  }
}

// 根据tab类型获取对应的服务数据
export const getServicesByTab = async (tabType: 'outpatient' | 'inpatient' | 'comprehensive') => {
  switch (tabType) {
    case 'outpatient':
      return await getOutpatientServices()
    case 'inpatient':
      return await getInpatientServices()
    case 'comprehensive':
      return await getComprehensiveServices()
    default:
      return await getOutpatientServices()
  }
}
